package com.sgj.gulimall.product.dao;

import com.sgj.gulimall.product.entity.SpuInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

/**
 * spu信息
 *
 * @author guojishen
 * @email 1261550408@qq.com
 * @date 2021-06-11 14:21:46
 */
@Mapper
public interface SpuInfoDao extends BaseMapper<SpuInfoEntity> {

    /**
     * 修改商品状态
     * @param spuId
     * @param code
     */
    @Transactional
    @Update("update pms_spu_info set publish_status = #{code}, update_time = NOW() where id = #{spuId}")
    void updateSpuStatus(@Param("spuId") Long spuId, @Param("code") int code);
}
